kappa1, a solution is to fit the correspondikappa2, a solution is to fit the corresponding Cox model using cross-validation (See cross.validation) with the death indicator as the event of interest. Sesummary.jointPenal,
print.jointPenal,
plot.jointPenal,
readmission,
terminal,
cluster### Joint model (recurrent and terminal events) with 2 covariates ###
### on a simulated dataset ###
data(readmission)
## Gap-time ##
modJoint_gap<-frailtyPenal(Surv(time,event)~cluster(id)+sex+as.factor(dukes)
+as.factor(charlson)+terminal(death),
formula.terminalEvent=~sex+as.factor(dukes)+as.factor(charlson),
data=readmission,n.knots=14,kappa1=9550000000,
kappa2=1410000000000,Frailty=TRUE,joint=TRUE,recurrentAG=FALSE)
## Calendar time ##
modJoint_calendar<-frailtyPenal(Surv(t.start,t.stop,event)~cluster(id)+sex
+as.factor(dukes)+as.factor(charlson)+terminal(death),
formula.terminalEvent=~sex+as.factor(dukes)+as.factor(charlson),
data=readmission,n.knots=10,kappa1=9550000000,
kappa2=1410000000000,Frailty=TRUE,joint=TRUE,recurrentAG=TRUE)
print(modJoint_gap)
summary(modJoint_gap)
plot(modJoint_gap)
print(modJoint_calendar)
summary(modJoint_calendar)
plot(modJoint_calendar)
# A model takes around 1 minute to converge #Run the code above in your browser using DataLab